package cn.ml.chuji.oop.valueAndReference;

public class He {
    public int num;

    public void ff(int num,int num2){
        System.out.println(num+num2);
    }

    public static void main(String[] args) {

        System.out.println("*************基本数据类型:*********************");
        int m = 10;
        int n = m;
        System.out.println("m = " + m + "___n = " + n);
        n = 20;
        System.out.println("m = " + m + "___n = " + n);

        System.out.println("*************引用数据类型:*********************");
        He he1 = new He();
        he1.num = 1001;
        He he2 = he1;   //赋值后，he1和he2的地址值相同，都指向了堆空间中的同一个对象实体
        System.out.println("he1.num = " + he1.num + "___he2.num = " + he2.num);


        he2.num = 1002;

        System.out.println("he1.num = " + he1.num + "___he2.num = " + he2.num);

        He a = new He();
        a.num = 10;
        a.ff(11,3);
    }




}
